home *** CD-ROM | disk | FTP | other *** search
/ PC User 2002 April / Disc 2 / PCUSER0402D2.iso / software / utils / files / wincron.exe / data1.cab / Sample_Scripts / AutoRun.tg < prev    next >
Encoding:
Text File  |  2001-10-20  |  1.8 KB  |  61 lines

  1. ##########################################################################
  2. ## AUTORUN.TG
  3. # This autorun script is run automatically when WinCron is started as a 
  4. #    service (but after Config.tg).
  5. # This is because it is difficult to pass parameters to a service.
  6. # if you wish WinCron to run this script when WinCron is *not* installed  
  7. #    as a service, you will need to pass this script to WinCron on the 
  8. #    command line or load it through the User Interface.
  9. # Auto loading scripts load in the following order:
  10. # Config.tg, (AutoRun.tg), (setup.tg), user.tg
  11. # Config.tg: This file unconditionally starts on WinCron boot
  12. # AutoRun.tg: This script will start IF WinCron is started as a service 
  13. # setup.tg: This script (if it exists) will run to finish WinCron installation  
  14. # user.tg: This is the user script and never over written by WinCron setup
  15. {
  16.     -name AUTORUN.TG
  17.     -start 
  18.     -stop
  19.  
  20.     ###
  21.     # Load old style .TAB file for backwards compatibility.
  22.     -action -load "%TG.ROOT_DIR%autorun.tab"
  23.  
  24.     ###
  25.     # run a subroutine with the same name as that of the current account.
  26.     # this allows us to run differently depending on how we were loaded/run
  27.     -action -call "%TG.ACCOUNT%"
  28.  
  29.     ###
  30.     # done!
  31.     -action -print AutoRun.tg: Complete.
  32. }
  33.  
  34. # when run as a system service in my account (PROXY)
  35. #    OR when run as application
  36. {
  37.     # the subroutine will have *your* account name by setting the 
  38.     # environment variable ACCOUNT_NAME in Config.tg.
  39.     -name %ACCOUNT_NAME%
  40.  
  41.     ###
  42.     # TODO: add your initialization code here
  43.  
  44.     ###
  45.     # done!
  46.     -action -print Running as %TG.ACCOUNT%
  47. }
  48.  
  49. # when run as a system service in LocalSystem account, the account name is 
  50. # "SYSTEM"
  51. {
  52.     -name SYSTEM
  53.  
  54.     ###
  55.     # TODO: add your initialization code here
  56.  
  57.     ###
  58.     # done!
  59.     -action -print Running as %TG.ACCOUNT%
  60. }
  61.